<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html>
<html>
   <head>
    	<title>论著列表</title>   
		<s:include value="../common/source.jsp"></s:include>	
		<script src="js/member.js"></script>
  </head>
  <body>  
   <jsp:include page="../admin/sendEmail.jsp"></jsp:include>
   <div class="body">
   <div class="content ui-sortable">
   <div class="list"> 
          	论著列表
       </div>   	
  	</div>
          	<br/>
          	<div class="load0">
        <form action="leader/excelTre.action"method="post">
        <input type="hidden" name="name" value=${treName }>
        <input type="hidden" name="flag" value=${flag }>
        <input type="hidden" name="date1" value=${date11 }>
        <input type="hidden" name="date2" value=${date22 }>
       <input type="submit" class="sui-btn btn-primary"  value="下载Excel">
       </form>  
         </div>
       
            <!--关键词搜索-->
                  <div class="search">
            <form action="leader/DirectTreatiseLikeNameAction" method="post">
              <label class="control-label v-top">输入关键词：</label>
             <input type="text"  class="sear" name="treName"> 
              <button type="submit" class="sui-btn btn-primary" >搜索</button>
            </form> 
              </div>
            <!--关键词搜索结束--> 
       <!--按年份搜索开始-->  
     <div class="year">                  
  	 <form action="leader/DirectTreatiseTimeAction" method="post">
         <span class="control-group">
          <label class="control-label v-top">开始年份：</label>
           <input type="text" class="sear"data-toggle="datepicker" value="" name="datedown">
        </span>
            <span class="control-group">
          <label class="control-label v-top">结束年份：</label>
          <span class="controls">
            <input type="text" class="sear" data-toggle="datepicker" value="" name="dateup">
            
          </span>
        </span> <button type="submit" class="sui-btn btn-primary" >搜索</button>
           </form>
            </div> 
             <div class="nopath">
           <form action="leader/DirectTreatiseStateAction?currentPage=1" method="post">
           <button type="submit" class="sui-btn btn-primary" >未审核项</button>
           </form>
           </div>
           <br/> 
          <hr style="background-color:#cfe1f9;height:1px;"/> 
           <!--                      <button id="down-button" class="sui-btn" type="button"><a href="#">下载Excel</a></button>
                      <br> -->
           <!--按年份搜索结束-->  
    <table class="sui-table table-primary table-sideheader">
          <thead>
            <tr>
              <th  style="width:4%;text-align:center">序号</th>
              <th  style="width:24%">论著名称</th>
              <th style="width:7%">第一作者</th>           
              <th style="width:6%">类型</th>
               <th style="width:15%">论著出版社</th>
               <th style="width:14%">书号</th>
              <th style="width:9%">出版日期</th>
              <th style="width:8%">审核状态</th>
              <th style="width:5%">留言</th> 
            <th style="width:4%">下载</th>  
             <th style="width:4%">流程</th>
            </tr>
          </thead>
          <tbody>
          <s:iterator value="Treatise">
          <tr>
               <td  style="text-align:center"></td>
              <td>
              <a href="admin/ReMendTreatiseAction.action?treatise.treId=<s:property value="treId"/>"><s:property value="name"/></a>
              </td>
              <td><s:property value="author"/></td>
        
               <td>
              <s:if test="class_==0">教材</s:if>
              <s:elseif test="class_==1">专著</s:elseif>
              <s:elseif test="class_==2">编著</s:elseif>
              <s:elseif test="class_==3">译著</s:elseif>
             </td>
        
              <td><s:property value="press"/></td>
              <td><s:property value="bookNum"/></td>
              <td><s:property value="date"/></td>
                 <td>
               <div class="control-group">
						<div class="controls ">
				            <span class="sui-dropdown dropdown-bordered select">
				              <span class="dropdown-inner">
				                <a id="drop4" role="button" data-toggle="dropdown" href="#" class="dropdown-toggle">
				                  <input value="hz" class="input-large" name="city" type="hidden"><i class="caret">
				                  </i>
				                  <span>
				                  <s:if test="state==0"><span  class="yellowColor">未审核</span></s:if>
				                  <s:elseif test="state==5"><span  class="greenColor">审核通过</span></s:elseif>
				                  <s:elseif test="state==4"><span  class="greenColor">已提交</span></s:elseif>
				                  <s:elseif test="state==3"><span  class="greenColor">提交不通过</span></s:elseif>
				                  </span>
				                </a>				              			                
				                <ul id="menu4" role="menu" aria-labelledby="drop4" class="sui-dropdown-menu">				                
				                  <li role="presentation">
				                  <s:if test="state==0 || state==3">
				                  <a href="leader/DirectTreatiseReturnAction?treatise.treId=<s:property value="treId"/>&currentPage=1"><span  class="greenColor">审核不通过</span></a>	
				                  <a href="leader/DirectTreatiseCheckAction?treatise.treId=<s:property value="treId"/>&currentPage=1"><span  class="greenColor">提交</span></a>	
				                  </s:if>
				                </ul>

				              </span>
				            </span>
				          </div>
					  </div>
              </td>
              <td><input type="submit" class="sui-btn btn-primary" value="留言" onclick="showPopup('<s:property value="teaId"/>')"/></td>
              <td>
              <a href="admin/FruitsFileDownloadAction.action?nameCom=<s:property value="upload"/>">下载</a>
              </td>
            <td><a href="teacher/flowTre.action?treatiseId=<s:property value="treId"/>">查看</a></td>
            </tr>  
          </s:iterator>        
          </tbody>
        </table>
                            <!--**************************** 开始进行分页显示 *******************************-->
        	      
        <div align="center" style="font-size: 12px">
         <!-- **************************************全部的分页****************** -->
                        <s:if test="flag==0">
							<s:if test="currentpage!=1">
								<a href="leader/AllDirectTreatiseAction?currentpage=1">首页</a> | 
								<a href="leader/AllDirectTreatiseAction?currentpage=<s:property value="currentpage-1"/>">上一页</a>
							</s:if>
							<s:if test="currentpage!=endpage&&endpage!=0">
								<a href="leader/AllDirectTreatiseAction?currentpage=<s:property value="currentpage+1"/>">下一页</a> | 
								<a href="leader/AllDirectTreatiseAction?currentpage=<s:property value="endpage"/>">尾页</a>
							</s:if>
							<s:if test="currentpage==1&&count==0">
							<div>对不起，你所查找的数据条数为0！</div>
							</s:if>
		                </s:if>

		  <!-- **************************************日期的分页****************** -->
                        <s:elseif test="flag==1">
							<s:if test="currentpage!=1">
								<a href="leader/DirectTreatiseTimeAction?currentpage=1&datedown=<s:property value="datedown"/>&dateup=<s:property value="dateup"/>">首页</a> | 
								<a href="leader/DirectTreatiseTimeAction?currentpage=<s:property value="currentpage-1"/>&datedown=<s:property value="datedown"/>&dateup=<s:property value="dateup"/>">上一页</a>
							</s:if>
							<s:if test="currentpage!=endpage&&endpage!=0">
								<a href="leader/DirectTreatiseTimeAction?currentpage=<s:property value="currentpage+1"/>&datedown=<s:property value="datedown"/>&dateup=<s:property value="dateup"/>">下一页</a> | 
								<a href="leader/DirectTreatiseTimeAction?currentpage=<s:property value="endpage"/>&datedown=<s:property value="datedown"/>&dateup=<s:property value="dateup"/>">尾页</a>
							</s:if>
							<s:if test="currentpage==1&&count==0">
							<div>对不起，你所查找的数据条数为0！</div>
							</s:if>
		                </s:elseif>
		                
         <!-- **************************************名称的分页****************** --> 
                        <s:elseif test="flag==2">
							<s:if test="currentpage!=1">
								<a href="leader/DirectTreatiseLikeNameAction?currentpage=1&treName=<s:property value="treName"/>&code=1">首页</a> | 
								<a href="leader/DirectTreatiseLikeNameAction?currentpage=<s:property value="currentpage-1"/>&treName=<s:property value="treName"/>&code=1">上一页</a>
							</s:if>
							<s:if test="currentpage!=endpage&&endpage!=0">
								<a href="leader/DirectTreatiseLikeNameAction?currentpage=<s:property value="currentpage+1"/>&treName=<s:property value="treName"/>&code=1">下一页</a> |
								<a href="leader/DirectTreatiseLikeNameAction?currentpage=<s:property value="endpage"/>&treName=<s:property value="treName"/>&code=1">尾页</a>
							</s:if>
							<s:if test="currentpage==1&&count==0">
							<div>对不起，你所查找的数据条数为0！</div>
							</s:if>
		                </s:elseif>
		                
		  <!-- **************************************审核类型的分页****************** --> 
                       <s:elseif test="flag==3">
							<s:if test="currentpage!=1">
								<a href="leader/DirectTreatiseStateAction?currentpage=1/>">首页</a> | 
								<a href="leader/DirectTreatiseStateAction?currentpage=<s:property value="currentpage-1"/>">上一页</a>
							</s:if>
							<s:if test="currentpage!=endpage&&endpage!=0">
								<a href="leader/DirectTreatiseStateAction?currentpage=<s:property value="currentpage+1"/>">下一页</a> |
								<a href="leader/DirectTreatiseStateAction?currentpage=<s:property value="endpage"/>">尾页</a>
							</s:if>
							<s:if test="currentpage==1&&count==0">
							<div>对不起，你所查找的数据条数为0！</div>
							</s:if>
		                </s:elseif>
						</div>	
        <script type="text/javascript">

	    var d = new Date();
		var date = d.getFullYear();
		var uu=document.getElementById("menu4");
		var tt=document.getElementById("menu6");
		var aa=uu.getElementsByTagName("a");
		var bb=tt.getElementsByTagName("a");
		
		   for(var i=0; i<aa.length;i++) 
		   {
		   	aa[i].innerHTML=date;
		   	//aa[i].value=date;a
		   	aa[i].setAttribute('value', date);
		   	date--;
		   } 
		   var date = d.getFullYear();
		   for(var i=0; i<bb.length;i++) 
		   {
		   	bb[i].innerHTML=date;
		   	bb[i].setAttribute('value',date);
		   	date--;
		   	aa[i].value=date;
		   } 
        
        </script>
         </div>
  </body>
</html>